import java.util.* ; 
import java.io.* ;
//https://ac.nowcoder.com/acm/problem/213140
public class MainNC213140{
    static PrintWriter out = new PrintWriter(
            new BufferedWriter(new OutputStreamWriter(System.out))) ;
    static Read in = new Read() ;
    public static void main(String[] args)throws IOException{
        int n = in.nextInt() ;
        int k = in.nextInt() ;
        long sum = 0 ;
        PriorityQueue<Integer> queue = new PriorityQueue<>((o1,o2)->o2-o1);
        for(int i=0 ; i < n ; i ++){
            int tmp = in.nextInt() ;
            if(tmp %2 == 0){
                queue.add(tmp) ;
            }
            sum += tmp ;
        }
        while(!queue.isEmpty() &&  k > 0){
            long tmp = (queue.poll() / 2) ;
            sum -= tmp ;
            if(tmp % 2 == 0){
                queue.add((int)tmp) ;
            }
            k -- ;
        }
        out.println(sum) ;
        out.close() ;
    }
}

class Read{
    StringTokenizer st = new StringTokenizer("");
    BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)) ;

    String next() throws IOException{
        while(!st.hasMoreTokens()){
            st = new StringTokenizer(bf.readLine()) ;
        }
        return st.nextToken() ;
    }

    String nextLine() throws IOException{

        return bf.readLine() ;
    }
    int nextInt() throws IOException{
        return Integer.parseInt(next()) ;
    }
}